#include<stdio.h>
int a, b,c;
int multiple(int, int);
int main()
{
	scanf("%d,%d", &a, &b);
	multiple(a, b);
	printf("%d", c);
}
int multiple(int a, int b)
{
	c = a + a * (b - 1);
	return c;
}